//
//  CoverCell.m
//  TongLeLe
//
//  Created by jianglinfeng on 16/4/12.
//  Copyright © 2016年 XDD. All rights reserved.
//

#import "CoverCell.h"
#import "UIView+Layout.h"

@interface CoverCell()


@end

@implementation CoverCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    //右上角删除按钮
    _deleteButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [_deleteButton setBackgroundImage:[UIImage imageNamed:@"information_delete_icon.png"] forState:UIControlStateNormal];
    [_deleteButton addTarget:self action:@selector(clickedDeleteButton) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:_deleteButton];
}

//点击删除按钮
- (void)clickedDeleteButton {

    if (self.didClickDeleteButton) {
        self.didClickDeleteButton(self);
    }
}

-(void)layoutSubviews {
    
    [super layoutSubviews];
    _deleteButton.frame = CGRectMake(self.width - 24, 0, 24, 24);
}

@end
